<?php
namespace App\Params\H5;
use App\Params\Param;
/**
 * 获取短信验证码参数
 *
 * @author: WangBin
 * @date: 2021/7/26
 * @mail: <849850352@qq.com>
 */
class GetSmsCodeParams extends Param
{
    public $mobile;
    public $scene;
    public $customer_id = 0;

    public function rules()
    {
        return [
            'mobile' => ['required', 'integer', 'regex:/^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/'],
            'scene' => 'required|string',
            'customer_id' => 'nullable|integer|min:0'
        ];
    }

    /**
     * @return int
     */
    public function getCustomerId(): int
    {
        return $this->customer_id;
    }

    /**
     * @param int $customer_id
     */
    public function setCustomerId(int $customer_id): void
    {
        $this->customer_id = $customer_id;
    }

    /**
     * @return mixed
     */
    public function getMobile()
    {
        return $this->mobile;
    }

    /**
     * @param mixed $mobile
     */
    public function setMobile($mobile): void
    {
        $this->mobile = $mobile;
    }

    /**
     * @return mixed
     */
    public function getScene()
    {
        return $this->scene;
    }

    /**
     * @param mixed $scene
     */
    public function setScene($scene): void
    {
        $this->scene = $scene;
    }
}